import service from '/@/utils/request';

export const useAttendEmployeeSummaryQueryApi = (code: string,) => {
    return service({
        url: `v0/attend/employeeSummary/query`,
        method: 'GET',
        params: { code: code },
    });
}
export const useAttendEmployeeSummaryCountApi = (formData?: object) => {
    return service({
        url: `v0/attend/employeeSummary/page`,
        method: 'POST',
        data: formData
    });
}

export const useAttendEmployeeSummaryCreateApi = (formData: object) => {
    return service({
        url: `v0/attend/employeeSummary/create`,
        method: 'POST',
        data: formData
    });
}
export const useAttendEmployeeSummaryUpdateApi = (formData: object) => {
    return service({
        url: `v0/attend/employeeSummary/update`,
        method: 'PUT',
        data: formData
    });
}

export const useAttendEmployeeSummaryDeleteApi = (param: string | string[]) => {
    let arrList: string[] = []

    if (param instanceof Array) {
        arrList = param
    } else {
        arrList.push(param)
    }

    return service({
        url: `v0/attend/employeeSummary/delete`,
        method: 'DELETE',
        data: { codeList: arrList }
    });
}

export const useAttendEmployeeSummaryListApi = () => {
    return service({
        url: `v0/attend/employeeSummary/list`,
        method: 'GET'
    });
}
